using System.Diagnostics;

namespace OOP.Liskov
{
    //
    // 
    interface IShape
    {
        public double Area(); 
    }

    class Rectangle: IShape
    {
        public Rectangle(double length, double width)
        {
            
        }
        public  double Area()
        {
            Console.WriteLine("Calculate Rect Area");
            return Length*Width;
        }
       
        public double Length {get; set;}
        public double Width {get; set;}
        
    }

    
    public class Liskov
    {
        public static void Show()
        {
            IShape shape = new Rectangle(10.0, 20.0);
            
            
            Rectangle rect = new Rectangle(10.0, 20.0);
            
            //使用shape的地方可以用rect代替
            Debug.Assert(shape.Area() == rect.Area()); 
        }
    }

    //
   
}